﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ProgNetExtensions.LanguageExt;
using ProgNetExtensions.Security;

namespace HomeHelper
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Language.Current = Language.GetLanguage("PL");
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Language.Current = Language.GetLanguage("EN");
        }

        private void gridView4_MasterRowGetRelationName(object sender, DevExpress.XtraGrid.Views.Grid.MasterRowGetRelationNameEventArgs e)
        {

        }

        private void gridView3_MasterRowGetRelationName(object sender, DevExpress.XtraGrid.Views.Grid.MasterRowGetRelationNameEventArgs e)
        {

        }

        private void button3_Click(object sender, EventArgs e)
        {
            dataSet1.SetTab.Clear();
            dataSet1.SetTab.Rows.Add("login_ja", true, true);
            dataSet1.SetTab.Rows.Add("login_ktos", true, true);
            dataSet1.SetTab.Rows.Add("lng_pl", true, true);
            dataSet1.SetTab.Rows.Add("lng_en", true, true);
            
            dataSet1.SetTab.Rows.Add("o1", true, true);
            dataSet1.SetTab.Rows.Add("o_powazne", true, true);
            dataSet1.SetTab.Rows.Add("o_setup", true, true);

            dataSet1.SetTab.Rows.Add("s2", true, true);
            dataSet1.SetTab.Rows.Add("s22", true, true,"s2");
            dataSet1.SetTab.Rows.Add("s23", true, true, "s2");
            dataSet1.SetTab.Rows.Add("s222", true, true,"s22");

            dataSet1.SetTab.AcceptChanges();
            SecurityInfo.EnabledColumn = "Enable";
            SecurityInfo.FalseValue = false;
            SecurityInfo.TrueValue = true;
            SecurityInfo.VisibleColumn = "Visible";
            SecurityInfo.NameColumn = "Name";
            SecurityInfo.ParentColumn = "Parent";
            SecurityInfo.SecurityTable = dataSet1.SetTab;

        }

        private void button4_Click(object sender, EventArgs e)
        {
            dataSet1.SetTab.Clear();
            dataSet1.SetTab.Rows.Add("login_ja", true, true);
            dataSet1.SetTab.Rows.Add("login_ktos", true, true);
            dataSet1.SetTab.Rows.Add("lng_pl", false, true);
            dataSet1.SetTab.Rows.Add("lng_en", true, false);

            dataSet1.SetTab.Rows.Add("o1", false, true);
            dataSet1.SetTab.Rows.Add("o_powazne", true, true);
            dataSet1.SetTab.Rows.Add("o_setup", true, true);

            dataSet1.SetTab.Rows.Add("s2", true, false);
            dataSet1.SetTab.Rows.Add("s22", true, true, "s2");
            dataSet1.SetTab.Rows.Add("s23", true, true, "s2");
            dataSet1.SetTab.Rows.Add("s222", true, true, "s22");

            dataSet1.SetTab.AcceptChanges();
            SecurityInfo.EnabledColumn = "Enable";
            SecurityInfo.FalseValue = false;
            SecurityInfo.TrueValue = true;
            SecurityInfo.VisibleColumn = "Visible";
            SecurityInfo.NameColumn = "Name";
            SecurityInfo.ParentColumn = "Parent";
            SecurityInfo.SecurityTable = dataSet1.SetTab;

        }
    }
}
